home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.07 Jul 90 / Printing Primer ƒ / PrintFootNote.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-07  |  2.0 KB  |  90 lines  |  [TEXT/KAHL]

  1. /*******************************************\
  2. *    file:         PrintFootNote.c                *
  3. *    version:    0.1ß                        *
  4. *     XFCN ID        505                            *
  5. *                                            *
  6. * Sets up the foot note that will be added    *
  7. * to the end of each page (at eject time    *
  8. *                                            *
  9. * -----------------------------------------    *
  10. * By:    Donald Koscheka                        *
  11. * Date:    30-OCT-89                            *
  12. * ©    Copyright 1989, Donald Koscheka            *
  13. *    All Rights Reserved                        *
  14. *                                            *
  15. * -----------------------------------------    *
  16. \*******************************************/
  17.  
  18.  
  19. #include <MacTypes.h>
  20. #include <MemoryMgr.h>
  21. #include <ResourceMgr.h>
  22. #include <OSUtil.h>
  23. #include <HyperXCmd.h>
  24. #include <HyperUtils.h>
  25. #include <PrintMgr.h>
  26. #include "ReportUtils.h"
  27.  
  28.  
  29.  
  30. pascal void main( paramPtr )
  31.     XCmdBlockPtr    paramPtr;
  32. /**********************************
  33. * params[0] == Client Name.
  34. * params[1] == Version Number.
  35. * params[2] == date.
  36. * params[3] == starting page number.
  37. **********************************/
  38. {
  39.     Handle        pH;
  40.     Handle        theText;
  41.     footPtr        myFoot;
  42.     pInfoPtr    pp;
  43.     FontInfo    fInfo;
  44.     GrafPtr        oldPort;
  45.     styleSet    footStyle;
  46.     
  47.     if( paramPtr->paramCount && ( pH = GetSystemResource( PAGE_INFO, PAGE_ID ) ) ){
  48.         pp = (pInfoPtr)*pH;
  49.         myFoot = (footPtr)&(pp->footNote);
  50.         
  51.         GetPort( &oldPort );
  52.         SetPort( (GrafPtr)(pp->prPort) );
  53.     
  54.         PenNormal();
  55.     
  56.         footStyle.Font = TIMES;
  57.         footStyle.Size = 12;
  58.         footStyle.Style= PLAIN_TEXT;
  59.         footStyle.Just = teJustLeft;
  60.         
  61.         SetFontStyles( pp, (stylePtr)&footStyle );
  62.         
  63.         GetFontInfo( &fInfo );
  64.         myFoot->hite    = (fInfo.ascent + fInfo.descent + fInfo.leading) * 3;
  65.     
  66.         /*** draw the company name and the version number ***/
  67.         if( theText = paramPtr->params[0] ){
  68.             HandToHand( &theText );
  69.             myFoot->key1 = theText;
  70.         }
  71.  
  72.         if( theText = paramPtr->params[1] ){
  73.             HandToHand( &theText );
  74.             myFoot->key2 = theText;
  75.         }
  76.         
  77.         /*** draw the date and the page number                ***/
  78.         if( theText = paramPtr->params[2] ){
  79.             HandToHand( &theText );
  80.             myFoot->key3 = theText;
  81.         }
  82.  
  83.         SetFontStyles( pp, (stylePtr)&(pp->defaultStyle) );
  84.         SetPort( oldPort );
  85.     }
  86.     
  87.     paramPtr->returnValue = NIL;
  88. }
  89.  
  90.